const express = require('express')
const app = express()
// 是应用程序实例
const middleware1 = (req,res,next)=>{
  
    console.log("中间件执行了")
    next();
}
const middleware2 = (req,res,next)=>{
  
    console.log("中间件执行了2")
    next();
}
const middleware3 = (req,res,next)=>{
  
    console.log("中间件执行了3")
    next();
}
const middleware4 = (req,res,next)=>{
  
    console.log("中间件执行了4")
    next();
}
const middleware5 = (req,res,next)=>{
  
    console.log("中间件执行了5")
    next();
}

app.use('/a',middleware1)
app.use('/a',middleware2)
app.use('/b',middleware3)
app.use('/',middleware4)
app.use(middleware5)
app.get('/a',(req,res)=>{
  
    res.send('hello express')
})
app.listen(3000,()=>{console.log('start at port 3000')})